package com.manor.paradise.adapter

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.manor.paradise.R
import com.manor.paradise.bean.HoneyBean
import java.math.BigDecimal

class HoneyAdapter(layoutResId: Int, data: MutableList<HoneyBean.RecordsBean>?) : BaseQuickAdapter<HoneyBean.RecordsBean, BaseViewHolder>
(layoutResId, data) {


    override fun convert(helper: BaseViewHolder, item: HoneyBean.RecordsBean) {
        var tv_sun = helper.getView<TextView>(R.id.tv_sun)
        var tv_time = helper.getView<TextView>(R.id.tv_time)
        var tv_jd = helper.getView<TextView>(R.id.tv_jd)
        tv_sun.setText(item.taskSize.toString())
        tv_time.setText(item.createTime.toString())
        tv_jd.setText(item.taskSize.divide(item.totalSize,2,BigDecimal.ROUND_DOWN).multiply(BigDecimal("100")).intValueExact().toString()+"%")
    }

}




